package GUI;

import com.sun.java.swing.plaf.motif.MotifLookAndFeel;
import com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel;
import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
import javax.swing.LookAndFeel;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.plaf.metal.MetalLookAndFeel;
import javax.swing.plaf.nimbus.NimbusLookAndFeel;

/**
 * <b>Use this class to change the Look and Feel of your project.</b>
 *
 * @author Mohamed Tarek Salama
 * @version 1.2 BETA
 */
public class MSJ_LookAndFeel {

    public static void SetLookAndFeel(LookAndFeel l) {
        try {
            UIManager.setLookAndFeel(l);
        } catch (UnsupportedLookAndFeelException ex) {
        }
    }

    /**
     * Set LookAndFeel to <b>Windows Classic</b>
     */
    public static void SetWindowsClassicLookAndFeel() {
        try {
            UIManager.setLookAndFeel(new WindowsClassicLookAndFeel());
        } catch (UnsupportedLookAndFeelException ex) {
        }
    }

    /**
     * Set LookAndFeel to <b>Nimbus</b>
     */
    public static void SetNimbusLookAndFeel() {
        try {
            UIManager.setLookAndFeel(new NimbusLookAndFeel());
        } catch (UnsupportedLookAndFeelException ex) {
        }
    }

    /**
     * Set LookAndFeel to <b>Metal</b>
     */
    public static void SetMetalLookAndFeel() {
        try {
            UIManager.setLookAndFeel(new MetalLookAndFeel());
        } catch (UnsupportedLookAndFeelException ex) {
        }
    }

    /**
     * Set LookAndFeel to <b>Windows</b>
     */
    public static void SetWindowsLookAndFeel() {
        try {
            UIManager.setLookAndFeel(new WindowsLookAndFeel());
        } catch (UnsupportedLookAndFeelException ex) {
        }
    }

    /**
     * Set LookAndFeel to <b>Motif</b>
     */
    public static void SetMotifLookAndFeel() {
        try {
            UIManager.setLookAndFeel(new MotifLookAndFeel());
        } catch (UnsupportedLookAndFeelException ex) {
        }
    }

    /**
     * Set LookAndFeel according to <b>String</b> classname
     *
     * @param classname : String
     */
    public static void SetMotifLookAndFeel(String classname) {
        try {
            UIManager.setLookAndFeel(classname);
        } catch (IllegalAccessException ex) {
        } catch (InstantiationException ex) {
        } catch (ClassNotFoundException ex) {
        } catch (UnsupportedLookAndFeelException ex) {
        }
    }
}
